# MEOWS 7.6 Year Data Release

Contains 336516 track-like events.

The release is organized into several items:

## `data.dat`

Contains the data. The file has 2 columns: 
- Energy (GeV)
- Zenith (radians)

## `monte_carlo.dat`

Contains the Monte Carlo. The file has 6 columns: 
- PDG ID number ($=\pm 14$, muon flavor only)
- reconstructed muon energy (GeV)
- reconstructed muon cos(Zenith)
- True neutrino energy (GeV)
- True neutrino cos(Zenith)
- oneweight
The quantity "oneweight" is the quantity that, when multiplied with the flux in units of $1/(\text{GeV} \: \text{cm}^2 \: \text{s} \: \text{sr})$ and the livetime in units of seconds, yields a physical weight. Hence the oneweight has units of $(\text{GeV} \: \text{cm}^2 \: \text{sr})$. It includes the weighting assciated with the detector and monte carlo generation.

## `systematics/`

Systematics (nuisance parameters) are presented in two ways: gradients and splines. 

Due to the analysis procedure, different nusiance parameters are applied in different formats. Hence not every parameter is available as a spline.

To apply the nusiance parameters, we apply a multiplicative factor on either their weights (the case with `splines`) or on binned histogram bin counts (the case with `gradients`). 

### `systematics/gradients/`

Bin-wise arrays of the quantity $1+(\Delta N / N)$, where $\Delta N$ is the difference in bin count given a $1\sigma$ variation in the nusiance parameter, and where $N$ is the nominal bin count, as a function of each bin.
- Exception: `hole_ice_scale` is not the 1-sigma variation but the change in parameter value from the nominal (-1) to a value of 0
- Exception: `domeff` is not the 1-sigma variation but the change in parameter value from the nominal (0.97, or 1.27) to a value of 0.98, or 1.28

### `systematics/splines/`

Spline files (`.fits`) return 3-d spline-interpolated values of a representative quantity such as $\log_{10}(N)$ (where $N$ is the rate), as a function of $\log_{10}(\text{energy})$, $\cos(\text{zenith})$, and the value of the nusiance parameter. The exact output quantity may be different depending on each nusiance parameter. The method to correctly read each spline file is included in the examples. These are usually separated into splines that apply to only conventional or prompt atmospheric neutrino fluxes. To get the full effect of the nusiance parameter, the effects must be added after they are applied to the weights.
- Exception: `AtmosphericKaonLossesSplines` (`kaon_scale`) and `AtmosphericZenithVariationSplines` (`airs_scale`) splines tabulate the change in bin count at the $1\sigma$ variation in the nuisance parameter

## `fluxes/`

Contains conventional atmospheric, prompt atmospheric, and astrophysical fluxes to be used for weighting. 

The conventional and prompt atmospheric fluxes are contained in `.h5` files, and they interface with the `nuSQuIDS` package. They are already earth-propagated, so they are the fluxes at the detector. They assume the HillasGaisser2012 CR model and the Sibyll 2.1 hadronic interaction model.  

The script `atm_flux_propagation_fromFile.py` reads these files and writes them to a `.npz` file with the muon neutrino and antineutrino fluxes for easy interpolation. The same script can also take a `.h5` file of the same format, but with unpropagated fluxes, and propagate them through the earth with [nuSQuIDS](https://github.com/arguelles/nuSQuIDS/tree/master) to obtain propagated fluxes at the detector. Therefore, a different flux in the correct `.h5` file format can easily be used as input, whether propagated or not. 

The script `atm_flux_propagation_fromNuFlux.py` makes the same output, but uses [NuFlux](https://docs.icecube.aq/nuflux/main/index.html) as input. This similarly allows for easy access to different atmospheric flux models. 

Finally, astrophysical fluxes are handled by the script `astro_flux_propagation.py` which simply assumes an astrophysical flux of `(0.787e-18)*(E_true / 100000 GeV)**(-2.5)` for each flavor and charge. They are propagated through the earth with nuSQuIDS, albeit without oscillations. 

The output to each flux component (i.e. tables of fluxes at the detector) are stored as `.npz` files in the same directory. If no changes to the given flux models are needed, these `.npz` files can be directly read in to weigh the events, as demonstrated in the examples. 

Some `.pdf` files contain plots of the propagated fluxes.

## `examples/` 

There are two Jupyter notebooks (`.ipynb`) that demonstrate some basic tasks. 

`basic_example.ipynb` opens the data and monte carlo, weights it, and plots some histograms. 

`best_fit.ipynb` demonstrates how to apply the systematic effects to the monte carlo, to reproduce the monte carlo at the best fit point which shows good agreement with data.

There are some `.png` figures that are output by the `.ipynb` notebooks. 